package l.l.w.practice.ReverseInteger;

import java.util.Scanner;

/**
 * Created by llw on 2017/10/3.
 */
public class ReverseInteger {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int result = new ReverseInteger().reverse(num);
        System.out.println(result);
    }

    public int reverse(int num) {
        int back = num;
        int[] chars = new int[5];
        int i = 0;
        while(num != 0){
            chars[i++]=num%10;
            num = num/10;
        }
        int reverse = 0;
        int q = 1;
        while(i >0){
            reverse += chars[--i]*q;
            q *=10;
        }
        return back+reverse;
    }
}
